1. Field
This invention relates generally to counters. In particular, the present invention relates to event based control of counters in an integrated circuit chip.
2. Description
An integrated circuit (IC) chip may use performance counters to monitor the performance of the chip in various ways. A performance counter may be used to count the number of data events occurring in a predetermined period of time at some regular or random interval. For example, some conventional processors have counters which count the number of instructions that have been run by the processor and/or the number of cache hits so that a ratio may be calculated of the number of cache bits per instruction.
Event based control of performance counters is typically limited to sampling counter values and is not actually controlled by the occurrence of actual hardware events. Typically, performance counter control is done in a time-based (polling) fashion. For example, U.S. Pat. No. 6,026,139 to Frank Hady et al deals with methods of using a counter in an integrated circuit chip to collect data for system performance tuning in each of a plurality of sample measurement periods. However, there are some sets of data that are only meaningful, or are more meaningful, in relation to the occurrence of other events. For example, it may be desired to know the number of times event A occurred between events B and C. In such cases, the regular or random sampling is insufficient to gather this type of data.
As an example, in graphics controllers it can be valuable to know the number of certain events (i.e., polygons filled) on a per frame basis. But the hardware of conventional graphics controllers does not support event based sampling. Therefore, a software controlled method for facilitating graphics event controlled sampling is used wherein special instructions are injected into the graphics software driver to notify the graphics controller hardware when to take a sample. Because of the need for interaction with the graphics software driver, software based event based sampling is limited to a few graphic events and very limited in its capabilities.
External observation tools, such as logic analyzers, may have the ability to trigger data captures. But they do not have the same capabilities as performance counters and cannot observe internal events.